<template>
  <div>
    <ul class="tebie">
      <li v-for="(value, index) in arr" @click="cha(index)" :key="index">
        {{ value.title }}
      </li>
    </ul>
    <ul class="tebie1">
      <li v-for="(value, index) in arrNew" :v-if="bool == true" :key="index">
        {{ value.title }}
        <img :src="srcc + value.pic" alt="" />
      </li>
    </ul>
  </div>
</template>
<style scoped>
* {
  margin: 0;
  padding: 0;
  font-size: 0.16rem;
}
li {
  list-style: none;
  font-size: 0.3rem;
  margin-top: 0.1rem;
}
.tebie li {
  float: left;
  width: 33%;
  overflow: hidden;
  color: #000;
}
.tebie1 li {
  color: #000;
}

li img {
  width: 1rem;
  height: 1rem;
}
p {
  width: 40rem;
}
.te {
  width: 9rem;
  height: 2rem;
}
.xin {
  width: 100%;
  overflow: hidden;
}
span {
  position: absolute;
}
.swiper-container {
  width: 100%;
  height: 100%;
}

.swiper-slide {
  text-align: center;
  font-size: 18px;
  background: #fff;
  height: 200px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
}
ul li {
  list-style: none;
  float: left;
  width: 30px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}
.banner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  margin-top: 60px;
}
.banner img {
  width: 100%;
  display: block;
}
.banner .page {
  background: rgba(0, 0, 0, 0.5);
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
}
.banner .page ul {
  float: right;
}
.current {
  color: #ff6700;
}
</style>
<script>
export default {
      props: ["arr"],
  data() {
    return {
      dataList: [],
      currentIndex: 0, //默认显示图片
      timer: null, //定时器
      arr: [],
      bool: false,
      n: "",
      arrNew: [],
      srcc: `https://jd.itying.com/`,
      arr1: [],
      m: 0,
    };
  },
  methods: {
    cha(index) {
      this.bool = true;
      this.n = this.arr[index]._id;
      this.axios("https://jd.itying.com/api/plist?cid=" + this.n).then(
        (res) => {
          this.arrNew = res.data.result;
          console.log(this.arrNew);
        }
      );
    },
  },
  computed: {},
  mounted() {
    // this.swiper.slideTo(3, 1000, false);
    this.axios("https://jd.itying.com/api/pcate").then((res) => {
      this.arr = res.data.result;
    });
  },
};
</script>
